package com.exercise.widgets.recyclerview

import android.content.Context
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import com.exercise.widgets.R
import com.exercise.widgets.recyclerview.selection.SelectionListActivity
import com.exercise.widgets.recyclerview.table.TableActivity
import com.google.android.material.button.MaterialButton

class ListActivity : AppCompatActivity(R.layout.activity_list) {
    companion object {
        fun start(context: Context) {
            Intent(context, ListActivity::class.java)
                .also {
                    context.startActivity(it)
                }
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        findViewById<MaterialButton>(R.id.rvSelection).setOnClickListener {
            SelectionListActivity.start(this)
        }
        findViewById<MaterialButton>(R.id.tableList).setOnClickListener {
            TableActivity.start(this)
        }
    }
}